package com.itheima;

import com.itheima.dao.OrderDao;
import com.itheima.factor.OrderDaoFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppForInstanceOrder {
    public static void main(String[] args){
//        创建ioc容器
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
//        使用工厂创建对象
//        OrderDao orderDao = OrderDaoFactory.getOrderDao();
//        orderDao.save();

        OrderDao orderDao = (OrderDao) ctx.getBean("orderDao");
        orderDao.save();
    }
}
